package tum0r.model;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;

public class ProblemInformation {
    /**
     * 题目标题
     */
    public String ProblemTitle;
    /**
     * 题目ID，用来获取flag
     */
    public int ProblemID;
    /**
     * 出题人
     */
    public String Creator;
    /**
     * 题目等级
     */
    public String ProblemLevel;
    /**
     * 出题时间
     */
    public String CreateTime;

    /**
     * 题目接口
     */
    public LinkedList<ProblemInfoItem> ProblemInfo = new LinkedList<>();

    public void setCreateTime(String time) {
        CreateTime = time;
    }

    public void setCreateTime(long time) {
        setCreateTime(new Date(time));
    }

    public void setCreateTime(Date time) {
        try {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd");
            CreateTime = simpleDateFormat.format(time);
        } catch (Exception ignored) {
            CreateTime = "1970/01/01";
        }
    }
}
